<?php
namespace app\api\model;
use think\Model;

class CourseArticle extends Model
{
    protected $table='cx_course_article';
    protected $pk='id';

    public function getAttr($name)
    {
    	$value = $this->getData($name);
    	if(in_array($name, ['picture'])) {
    		if(strstr($value,'hqrw-cdn')) {
    			$value = str_replace('hqrw-cdn.xiaocx.org', 'hqimg.madridwine.cn', $value);
    		}
    		return $value.'?imageslim';
    	}
    	return $value;
    }
}